package com.thermofisher.dsc.amanda.model.dto.promotion;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.thermofisher.dsc.amanda.model.BaseModel;
import lombok.Getter;
import lombok.Setter;

import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;


@Getter
@Setter
public class PromotionDto extends BaseModel {

    private String skuNO;

    private String promotionName;

    private Date startDate;

    private Date endDate;

    private String quoteOnline;

    private String quoteOffline;

    private String quoteInternal;

    @JsonIgnore
    private Float bundlePrice;

    private String bundlePriceStr;

    @JsonIgnore
    private Float bundleListPrice;

    private String bundleListPriceStr;

    private List<PromotionSKUDto> detail;

    public String getBundlePriceStr() {
        if (bundlePrice != null){
            DecimalFormat decimalFormat = new DecimalFormat("###,###.00");
            return decimalFormat.format(bundlePrice);
        }
        return null;
    }

    public String getBundleListPriceStr() {
        if (bundleListPrice != null){
            DecimalFormat decimalFormat = new DecimalFormat("###,###.00");
            return decimalFormat.format(bundleListPrice);
        }
        return null;
    }

}
